* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Sarabun', sans-serif;
}

body {
  background: #f9f9f9;
  line-height: 1.6;
}

.logo {
  text-align: center;
  padding: 10px;
}

.logo img {
  max-width: 100%;
  height: auto;
}

/* 2. Marquee running text */
.font-run {
  background: #006699;
  color: #fff;
  padding: 5px 0;
}

.marquee p {
  white-space: nowrap;
  overflow: hidden;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* 3. Navigation bar */
.nav ul {
  list-style: none;
  background: #003366;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nav li {
  position: relative;
}

.nav a {
  display: block;
  padding: 15px 20px;
  text-decoration: none;
  color: #fff;
}

.nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #003366;
}

.nav li:hover ul {
  display: block;
}

.nav li ul li a {
  padding: 10px 20px;
}

/* 4. Header title */
.head2 {
  text-align: center;
  padding: 20px;
  background: #e0e0e0;
}

.head2 h1 {
  font-size: 24px;
}

/* 5. Container layout */
.container {
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  gap: 20px;
}

/* 6. Box-left menu */
.box-left {
  flex: 0 0 180px; /* กำหนดความกว้างตายตัว 180px */
  min-width: 150px; /* กำหนดความกว้างขั้นต่ำ */
  max-width: 200px; /* กำหนดความกว้างสูงสุด */
  padding-right: 15px; /* เว้นขอบขวานิดหน่อย */
  box-sizing: border-box;
}
.box-left .box-menu {
  font-size: 18px;
  padding: 8px 10px;
  display: block;
}


.box-left-search {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.box-menu {
  display: block;
  padding: 10px;
  margin-bottom: 5px;
  background: #006699;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
}

.box-menu:hover {
  background: #004466;
}

/* 7. Box-right grid */
.box-right {
  flex: 3;
}

.box-item {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.box-item img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ccc;
}

/* 8. Footer */
footer {
  background: #333;
  color: #fff;
  margin-top: 50px;
  padding: 20px 0;
}

.footer-top-con {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

.footer-top-item {
  flex: 1;
  min-width: 250px;
  margin: 10px;
}

.footer-top-item h6 {
  font-size: 18px;
  margin-bottom: 10px;
}

.footer-top-item p {
  margin-bottom: 5px;
}

.footer-top-item iframe {
  width: 100%;
  max-width: 600px;
  height: 300px;
  border: none;
}

/* 9. Responsive adjustments */
@media (max-width: 768px) {
  .nav ul {
    flex-direction: column;
  }

  .footer-top-con {
    flex-direction: column;
    align-items: center;
  }
}
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .box-left {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  .box-right {
    order: 1;
    width: 100%;
  }

  .box-item {
    grid-template-columns: 1fr; /* แสดงทีละรูปเต็มจอ */
  }
}
.box-item {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .box-item {
    grid-template-columns: 1fr; /* มือถือ: เรียงลงทีละรูป */
  }
}